$(document).ready(
	function(){
		$('.to-del').on('click',function(event){
			event.preventDefault();
			$.ajax({
				url:$(this).attr('href'),
				type:'GET',
				success: function(data){
					alert(data.data);
					window.location.href ='index?p=1';
				}
			});
		});

		$('.disabled').on('click',function(event){
			event.preventDefault();
		});

		$("#p").on('change',function(){
			window.location.href = "index?p="+$(this).val();
		});

		$('#search_content').on('keypress',function(event){
			if(event.keyCode == 13){
				window.location.href = "index?search_content="+$(this).val();
			}
		});

		$('#search_content').on('blur',function(event){
			window.location.href = "index?search_content="+$(this).val();
		});

		$(".menu").load('/Funny/public/htm/menu.html');
		$(".J_deploy").click(
			function(e){
				e.preventDefault();
				$.ajax({
					type: 'GET',
					url: $(".J_deploy").attr("href"),
					complete:function(){
						alert("部署命令已发送");
						$(window).attr('location', $(".J_deploy").attr("val"));
					}
				});
			});

		$(".J_del").click(
			function(e){
				e.preventDefault();
				$.ajax({
					type:"GET",
					url:$(".J_del").attr("href"),
					complete:function(data){
						if(200==data.status){
							alert("删除成功");

						}else{
							alert("删除失败");
						}
						window.location.reload();
					}
				});
			});
		});